package com.typy.www.tpay.util;

import android.util.Log;

import java.io.File;
import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

/**
 * Created by 13799 on 2018/6/24.
 */

public class OkHttpUtils {
//    /**
//     * 异步上传文件
//     */
//    private void postAsynFile() {
//        OkHttpClient mOkHttpClient=new OkHttpClient();
//        File file = new File("/sdcard/123.txt");
//        Request request = new Request.Builder()
//                .url("https://www.****.php")
//                .post(RequestBody.create(MEDIA_TYPE_MARKDOWN, file))
//                .build();
//
//        mOkHttpClient.newCall(request).enqueue(new Callback() {
//            @Override
//            public void onFailure(Call call, IOException e) {
//
//            }
//
//            @Override
//            public void onResponse(Call call, Response response) throws IOException {
//                Log.i("InfoMSG",response.body().string());
//            }
//        });
//    }
}
